#!/bin/bash

# Usage: ./batch_gen_pdf_report.sh <PARENT_ANALYSIS_DIR> <IMAGE_DIR>
if [ "$#" -lt 2 ]; then
    echo "Usage: $0 <PARENT_ANALYSIS_DIR> <IMAGE_DIR>"
    exit 1
fi

PARENT_ANALYSIS_DIR="$1"
IMAGE_DIR="$2"
SEED=42

for ANALYSIS_DIR in "$PARENT_ANALYSIS_DIR"/*/; do
    if [ -d "$ANALYSIS_DIR" ]; then
        echo "Processing $ANALYSIS_DIR ..."
        python3 generate_pdf_report.py --analysis_dir "$ANALYSIS_DIR" --image_dir "$IMAGE_DIR" --seed "$SEED"
    fi
done

echo "All done."